<%--
  Created by IntelliJ IDEA.
  User: sofwin
  Date: 2021/7/13
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String path = request.getContextPath()+"/";%>
<!doctype html>
<html>
<head>
    <base href="<%=path%>">
    <title>编辑用户信息</title>
    <link href="bootstrap/css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
    <%--    <link href="bootstrap/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">--%>
    <script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/plugins/layer/layer.min.js"></script>
    <link href="bootstrap/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="bootstrap/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="bootstrap/css/animate.css" rel="stylesheet">
    <link href="bootstrap/css/style.css?v=4.1.0" rel="stylesheet">
    <script type="text/javascript" src="bootstrap/js/ry.js"></script>
<style>
    input{
        width:60%;
    }
</style>
</head>
<body>
<form class="form-horizontal">
    <input type="hidden" name="sysId" value="${user.sysId}"/>
    <div class="form-group">
        <label for="loginAccount" class="col-sm-2 control-label">登录名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="loginAccount" value="${user.loginAccount}" name="loginAccount" placeholder="">
        </div>
    </div>
    <div class="form-group">
        <label for="loginPwd" class="col-sm-2 control-label">登录密码</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="loginPwd" value="${user.loginPwd}" name="loginPwd" placeholder="">
        </div>
    </div>
    <div class="form-group">
        <label for="realName" class="col-sm-2 control-label" >姓名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="realName" value="${user.realName}" name="realName" placeholder="">
        </div>
    </div>
    <div class="form-group">
        <label for="mobile" class="col-sm-2 control-label">手机号</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="mobile" value="${user.mobile}" name="mobile" placeholder="">
        </div>
    </div>
    <div class="form-group">
        <label for="email" class="col-sm-2 control-label">邮箱</label>
        <div class="col-sm-10">
            <input type="email" class="form-control" id="email" value="${user.email}" name="email" placeholder="">
        </div>
    </div>
    <div class="form-group">
        <label for="status" class="col-sm-2 control-label">所属部门</label>
        <div class="col-sm-10">
            <select class="form-control" name="deptId" id="deptId">
                <c:forEach items="${depts}" var="role">
                    <option value="${role.deptId}" <c:if test="${user.deptId==role.deptId}">selected</c:if>>${role.deptName}</option>
                </c:forEach>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="status" class="col-sm-2 control-label">所属角色</label>
        <div class="col-sm-10">
            <select class="form-control" name="roleId" id="roleId">
                <c:forEach items="${roles}" var="role">
                    <option value="${role.roleId}" <c:if test="${user.roleId==role.roleId}">selected</c:if>>${role.roleName}</option>
                </c:forEach>
                </select>
        </div>
    </div>
    <div class="form-group">
        <label for="status" class="col-sm-2 control-label">用户状态</label>
        <div class="col-sm-10">
            <select class="form-control" name="status" id="status">
                <option value="1" <c:if test="${user.status==1}">selected</c:if>>启用</option>
                <option value="0" <c:if test="${user.status==0}">selected</c:if>>禁用</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" id="save" class="btn btn-default">
            <i class="fa fa-save"></i>
                保存</button>
            <button type="reset"  class="btn btn-default">
                <i class="fa fa-refresh"></i>
                重置</button>
        </div>
    </div>
</form>
</body>
<script>
    $(function(){
        $("#save").click(function(){
            $.modal.saveWindow('user/save',$("form").serialize());
        })
    })
</script>
</html>
